[Aldor-l] is sal_sfloat.as buggy?

Stephen Watt watt at scl.csd.uwo.ca
Mon Sep 24 05:45:54 EDT 2007


David, what warnings are you getting?

All three versions should give the right widths for the values.

We want to be careful about the pretends implied by the rep operators 
because we dont want any unsigned->float conversions to take place.  
We just ant a re-interpretation cast in the generated C.

If the import statement reads  ... from Foreign C("math.h")  then that
should generate a #include <math.h> rather than a prototype.

-- Stephen


On Mon, Sep 24, 2007 at 10:48:23AM +0200, Ralf Hemmecke wrote:
> Hi David,
> 
> Looks like a bug to me. But it should rather read...
> 
> 	(a:%) ^ (b:%):%	== {
> 		import { powf: (%, %) -> % } from Foreign C;
> 		per powf(rep a, rep b);
> 	}
> 
> Would someone disagree?
> 
> Ralf
> 
> 
> 
> On 09/24/2007 05:24 AM, David Casperson wrote:
> > sal_sfloat.as in lib/aldor/src/arith/ contains the lines
> > 
> > ----------------------------------------------------------------------
> >      Rep == SFlo;
> > 
> > -- ...
> > 
> >  	(a:%) ^ (b:%):%	== {
> >  		import { powf: (%, %) -> % } from Foreign C;
> >  		powf(a, b);
> >  	}
> > ----------------------------------------------------------------------
> > 
> > am I hallucinating or shouldn't this be?
> > 
> > ----------------------------------------------------------------------
> >      Rep == SFlo;
> > 
> > -- ...
> > 
> >  	(a:%) ^ (b:%):%	== {
> >  		import { powf: (Rep, Rep) -> Rep } from Foreign C;
> >  		per powf(rep a, rep b);
> >  	}
> > ----------------------------------------------------------------------
> > 
> > The current version gives warning messages about type mismatches.
> 
> _______________________________________________
> Aldor-l mailing list
> Aldor-l at aldor.org
> http://aldor.org/mailman/listinfo/aldor-l_aldor.org



More information about the Aldor-l mailing list