[m-dev.] inf or infinity

Ben Schmidt schmidtb at student.unimelb.edu.au
Wed Aug 13 15:50:24 AEST 2014


On 13/08/14 3:30 PM, Julien Fischer wrote:
> On Wed, Aug 13, 2014 at 3:26 PM, Ben Schmidt <schmidtb at student.unimelb.edu.au
> <mailto:schmidtb at student.unimelb.edu.au>> wrote:
>
>     I prefer the shorter 'inf', because you can also use 'NaN' (or 'nan'), whereas
>     not_a_number is somewhat cumbersome.
>
>
> Using "infinity" does not mean we can not also use "nan".

Of course, but I'm a programmer; I like consistency. :-p

If you use 'inf', I'll automatically try 'nan' as it's the corresponding 
abbreviation (and vice-versa). I would also guess 'inf' before trying 'infinity', 
but that's probably as much to do with how I 'grew up' as anything else.

If you use 'infinity', I'll stop and think "What am I supposed to use?"

In the end it really doesn't matter. Plenty of languages use things yuckier than 
either, with no consistency. Plenty don't even support IEEE754.

Is mercury unicode? Just use ±∞. :-D

Ben.





More information about the developers mailing list