[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Mod math function in JavaScript




----------
From: 	Dan Petramala[SMTP:vicnot@igc.net]
Sent: 	Thursday, February 22, 1996 3:56 AM
To: 	javascript@obscure.org
Subject: 	Mod math function in JavaScript


I looked through some JavaScript  refernece on the Netscape homepage.... But
things were kind of slow so I did not get very far.


I am looking to start a Javascript, but I need the math MOD function to be
available.  

Does JavaScript have support for the MOD function and if not how has anyone else
got around this?

Dan,

Yes, use the % operator:

var mytime=1+(clockhour%12);

-- Kurt Cagle 

begin 600 WINMAIL.DAT
M>)\^(@$(`0:0" `$```````!``$``0>0!@`(````Y 0```````#H``$-@ 0`
M`@````(``@`!!) &`"@!```!````# ````,``# #````"P`/#@`````"`?\/
M`0```$L`````````@2L?I+ZC$!F=;@#=`0]4`@````!J879A<V-R:7!T0&]B
M<V-U<F4N;W)G`%--5% `:F%V87-C<FEP=$!O8G-C=7)E+F]R9P``'@`", $`
M```%````4TU44 `````>``,P`0```!<```!J879A<V-R:7!T0&]B<V-U<F4N
M;W)G```#`!4,`0````,`_@\&````'@`!, $````9````)VIA=F%S8W)I<'1 
M;V)S8W5R92YO<F<G``````(!"S !````' ```%--5% Z2D%605-#4DE05$!/
M0E-#55)%+D]21P`#```Y``````L`0#H!`````@'V#P$````$`````````],Y
M`0B !P`8````25!-+DUI8W)O<V]F="!-86EL+DYO=&4`,0@!!( !`"0```!2
M13H@36]D(&UA=&@@9G5N8W1I;VX@:6X@2F%V85-C<FEP= !O# $%@ ,`#@``
M`,P'`@`6`!<`,@`R``0`:@$!(( #``X```#,!P(`%@`7`#(``P`$`#L!`0F 
M`0`A````039".#-$-$(V139$0T8Q,3DQ-T8T-#0U-3,U-# P,# `!P<!`Y &
M`$P$```2````"P`C```````#`"8```````L`*0```````P`V``````! `#D`
M@(%LIL,!NP$>`' ``0```"0```!213H@36]D(&UA=&@@9G5N8W1I;VX@:6X@
M2F%V85-C<FEP= `"`7$``0```!8````!NP'#IF-+/;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&\'X!& !" `<'D"(#QP9=YL$; X/SE/'H5G0I$*
MP.<(8$%!0&%S/QG,2JX`<-HL-\Q9!Y J<'41L#X3GB4]X#[ )"!%L'(Z-\PS
M,$ %P&UY-J '@#TQR"LH8Q6@8VL^\ AP8"4Q,BD[-\P>\"#V2PAP!4!#/T!*
M8!KF%3$"`%V@``,`$! ``````P`1$ ````! ``<P@&2'BL,!NP% ``@P@&2'
;BL,!NP$>`#T``0````4```!213H@``````$U
`
end

--------------------------------------------------------------------
This message came from the mailing list javascript. For help using the
mailing list software, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.