http://qs321.pair.com?node_id=724182


in reply to Re: modulus and floating point numbers
in thread modulus and floating point numbers

how about .00001 ?
  • Comment on Re^2: modulus and floating point numbers

Replies are listed 'Best First'.
Re^3: modulus and floating point numbers
by BrowserUk (Patriarch) on Nov 18, 2008 at 03:34 UTC

    I'm not sure if I understand the question, but:

    [0] Perl> print fmod( $_, 100 ) for 12300, 12301, 12399, .00001;; 0 1 99 1e-005

    Or do you mean this:

    [0] Perl> print fmod( $_, 1 ) for map{ ($_, -$_ ) } 12300, 12301, 1239 +9, .00001;; 0 0 0 0 0 0 1e-005 -1e-005

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.