Actually, the difference comes from the fact that in .NET 1.1 the System.Math.Floor() had only one function prototype: System.Math.Floor(double). In .NET 2.0 there are now two prototypes: System.Math.Floor(double) and System.Math.Floor (decimal).  In .NET 1.1 all other types were automatically converted to double for the Floor function.  In .NET 2.0 the compiler does not know what conversion to do on its own since there are now two possibilities.

Sorry, I wasn't clear in my last message about this... the decimal type itself is not new, but the decimal type is new for .NET 2.0's Floor function.

73 de Phil N8VB


On 11/10/05, Eric Wachsmann - FlexRadio <[EMAIL PROTECTED]> wrote:

Phil,

 

I have made the changes to the source for Preview 5.  It is interesting that this cast is required though.  The decimal type is present in v1.1, but I guess the rules about automatic casting have changed.  It looks like in v2.0 when you use 2 doubles, it possibly upcasts to a decimal.  In v1.1, it would just use a double.

 

 

Eric Wachsmann

FlexRadio Systems

 

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Philip Covington
Sent: Thursday, November 10, 2005 11:22 AM
To: Sami Aintila
Cc: FlexRadio Reflector
Subject: Re: [Flexradio] update to .net

 

A really simple change is all that is required.

To compile PowerSDR console with either .
NET 1.1 or .NET 2.0 this simple change would have to be made to:

Lines:
12147

12221
12301

12435
12510
12591
12710
12753
12802

the change is: 

original code:  ...(int)Math.Floor((spectrum_grid_max -num)...

.NET 1.1 and .NET 2.0 code:  ...(int)Math.Floor((double)(spectrum_grid_max -num)...

Note the cast to double to unconfuse the compiler about whether Math.Floor is dealing with a double type or a decimal (new in .NET 2.0) type.

By making this change to the current source code, PowerSDR console with compile with both VS 2003/.NET1.1 or VS 2005/.NET2.0 (and Express).

Phil N8VB




--
Philip A Covington
http://www.philcovington.com

Reply via email to