Compiler Error (Wings3d on Mac OS X)

Brent Fulgham <>
Thu Jul 21 05:40:24 CEST 2005


On Jul 20, 2005, at 1:06 AM, Kostis Sagonas wrote:

> Make the code look as follows and it will pass the compiler:
>
> internal_rgb_to_hsv(R, G, B) ->
>      Max = lists:max([R,G,B]),
>      Min = lists:min([R,G,B]),
>      V = Max,
>      {Hue,Sat} = %% try
>                      {if
>                           Min == B -> (G-Min)/(R+G-2.0*Min);
>                           Min == R -> (1.0+(B-Min)/(B+G-2.0*Min));
>                           Min == G -> (2.0+(R-Min)/(B+R-2.0*Min))
>                       end*120,(Max-Min)/Max}
>                  %% catch
>                  %%     error:badarith ->
>                  %%         {undefined,0.0}
>                  %% end
>          ,
>      {Hue,Sat,V}.

Well, this certainly allows the compile to continue, but I run across  
man more cases of the try/catch causing problems.  They all seem to  
be related to error:badarith.

Apparently, this is a bug in R10B-6, which will be corrected in  
R10B-7 (per http://sourceforge.net/tracker/index.php? 
func=detail&aid=1231771&group_id=33028&atid=406952).

-Brent
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20050720/ea383f29/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20050720/ea383f29/attachment.bin>


More information about the erlang-questions mailing list