Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Complex NaN / infinity?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-11-16 (18:02)
From: Chris King <colanderman@g...>
Subject: Complex NaN / infinity?

It's been reported before as a bug [1] that Caml's Complex module
doesn't properly support complex NaN and infinities: the current
behavior is that expressions such as "div one zero" return a complex
number with real and imaginary parts both set to NaN.  The proper
behavior would be to return a value representing directed or complex
infinity, depending on whether "zero" is directed or not.  Avoiding
infinite results doesn't help either, since expressions such as "pow
zero one" rely on infinity internally.

Has anyone made a replacement module fixing these problems?  I've
started work on a replacement which uses both polar and Cartesian
representations internally but I figure I'd ask before duplicating

- Chris King