.
If there is no problem with recursive calls you can use String.Format.
Greetings
Andreas
_
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von Dennis
Hayes
Gesendet: Donnerstag, 15. März 2007 22:55
An: mono-devel-list@lists.ximian.com
Betreff: [Mono-dev] Patch for Math.cs and MathTest.cs
Hello,
Locale.GetText (The value ' + mode + ' is not valid for this usage
of the type MidpointRounding.)
That is not going to work, because you would have to localize every
possible concatenated string combination. Moreover tools wouldn't be
able to extract the neccessary string data.
: 'Dennis Hayes'; mono-devel-list@lists.ximian.com
Betreff: Re: [Mono-dev] Patch for Math.cs and MathTest.cs
Hello,
Locale.GetText (The value ' + mode + ' is not valid for this usage
of the type MidpointRounding.)
That is not going to work, because you would have to localize every
possible
Math.cs
Added Locale.GetText to all strings.
Rearranged Rounding with MidPoint to minimize compairs, and to clean up a
bit.
MathTest.cs
Added quite a few new tests for rounding, including test for
the 2.0 rounding with midpoint.
It also incudes new test for
Hello,
The patch should use:
throw new ArgumentException (Locale.GetText ())
So that this can be later internationalized.
Can someone send me the updated patch?
Just out of interest, could you check the performance of the method if
you change code patterns like:
I am working on updated test and patch.
I expect to have them done tonight or tommorrow.
I will add the internationalization fix also.
Dennis
Miguel de Icaza [EMAIL PROTECTED] wrote:
Hello,
The patch should use:
throw new ArgumentException (Locale.GetText ())
So that this can be
This is a minor clean up of Math.cs.
Basicly, in the methods that use MidpointRounding Mode, it moves the check
for a valid mode to the end of the method.
Since the mode is checked in the method, doing this eliminates the extra
check. Also, the check should never fail, since an enum is
Just out of interest, could you check the performance of the method if you
change code patterns like:
if (value 0)
return Floor (value + 0.5);
else
return Ceiling (value - 0.5);
to:
return (value 0) ? Floor(value+0.5) : Ceiling(value - 0.5);
When i was profiling stuff before i think
I'm not a Mono dev so I may be wrong, but see my two comments below.
On 3/4/07, Dennis Hayes [EMAIL PROTECTED] wrote:
@@ -411,26 +411,25 @@
#if NET_2_0
public static double Round (double value, MidpointRounding
mode)
{
- if ((mode !=
Forgive the terrible indenting on the code: http://pastebin.ca/381736
But that indicates a huge difference between performance when using turnary
as opposed to if/else. Turns out if/else is much much faster.
What the hell?
Alan.
On 3/5/07, Felipe Almeida Lessa [EMAIL PROTECTED] wrote:
I'm
10 matches
Mail list logo