Rounding problem

Jan 31, 2009 at 9:28pm

Rounding problem

If I create a 207.65 Hz triangular wave for exemple, it create a 207.649994 Hz triangular wave… Why ?

– Pasted Max Patch, click to expand. –
#42031
Jan 31, 2009 at 11:14pm

Quote: Bertrand Fraysse wrote on Sat, 31 January 2009 13:28
—————————————————-
> If I create a 207.65 Hz triangular wave for exemple, it create a 207.649994 Hz triangular wave… Why ?
>
>

– Pasted Max Patch, click to expand. –

>
—————————————————-

Floating point numbers work that way; they aren’t infinitely precise.

http://en.wikipedia.org/wiki/Floating-point

You can hardly hear the difference, though.

mz

#150176
Jan 31, 2009 at 11:26pm

The difference in frequencies is 0.000006 hz which equates to a beat repetition period of about 46 hours. Not audible.
>
> You can hardly hear the difference, though.
>
> mz
>
>
—————————————————-

#150177
Jan 31, 2009 at 11:41pm

Yes I agree, I can’t hear the difference, but I don’t remember this hapenning in Max 4…
207.65 does not have to be changed, or I don’t understand why it has to show it. My object box is a lot larger for no reason.
But… It’s not a big problem.

#150178
Feb 1, 2009 at 12:07am

If the long float displays are harshing your mellow (as they sometimes do for me), check ‘Float Display Correction’ in the Interface Pane of the Preferences window. This will make Max truncate numbers at what it guesses is the least significant digit.

-Ben

#150179
Feb 1, 2009 at 12:27am

Great ! Thank you very much Ben.

#150180

You must be logged in to reply to this topic.