[erlang-questions] erlang float comparison

Pierpaolo Bernardi olopierpa@REDACTED
Tue May 15 12:06:04 CEST 2012


On Tue, May 15, 2012 at 12:02 PM, Pierpaolo Bernardi
<olopierpa@REDACTED> wrote:
> On Tue, May 15, 2012 at 11:04 AM, Angel J. Alvarez Miguel <clist@REDACTED> wrote:
>
>> The problem can be stated as:
>>
>> Result = case Myfloat > 1.0 of
>>        true -> 1.0;
>>        false MyFloat
>>        end
>> ...
>> ...
>> math:acos(Result).
>>
>> after that  we came across some values that fail to pass the test > 1.0 but are seen
>> as greater to the math:acos function rendering a bad arithmetic expression error
>
> If true, this indicates a serious bug.  You should report such cases.

Assuming is not MyFloat < -1, that is.

Cheers
P.



More information about the erlang-questions mailing list