|
OriginalGriff wrote: Bug report: it fails with "serviceS".
Dear Mr./Ms. User,
We are currently offering support for "services", "Services", "SERVICES" (based on user skill - does not know about text formatting rules, knows about text formatting rules, does not know about CAPS LOCK key) and we plan to support "sERVICES" (for users who know formatting rules but forgot about CAPS LOCK key) in future releases.
As far as we see, "serviceS" is an anomaly and it should not be considered a bug.
Yours trully,
Programming Team Leader.I have no smart signature yet...
|
|
|
|
|
Development team answer:
This is not a bug. All key values must be uppercase.
We are simplifying the application so services and Services are no more supported, avoiding further errors.
In fact, the check is now:
If len(vkeys[lval, 0]) = 8 and Mid(lvkeys[lval, 0], 0, 1) = "S" and Mid(lvkeys[lval, 0], 1, 1) = "E" ... and so on.
(Note, I started to write this at the same time of the last post... I think our development team is having problems of communication... who the hell tought we must support other keywords?? ).
|
|
|
|
|
This is an excerpt from some sample code provided in the documentation for an EFT interface
decimal divider;
divider = 10*10*10;
divider = Decimal.Multiply(divider,10*10*10*10*10);
divider = Decimal.Multiply(divider,10*10*10*10*10);
divider = Decimal.Multiply(divider,10*10*10*10*10);
Blows my mind
|
|
|
|
|
Never mind casting - at least he didn't use a loop:
decimal tenE18 = 1;
for (int i = 0; i < 18; i++)
{
tenE18 *= 10;
}
Still, I think I will stick to the old-fashioned, boring way:
decimal d = 1E18M;
[edit]Got the number of zeros wrong, didn't I? Oops.[/edit]You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
modified on Wednesday, March 3, 2010 11:21 AM
|
|
|
|
|
|
test your code - it saves processing time, but raises debug time - if you are able to compile it
|
|
|
|
|
it might have a syntax error but you can do it this way.. you can refer algorithm by corman... n compare to given algo
for (int i = 0; i < 18; i++)
{
tenE18 *= 10;
}
this one will run for 18times.. for debuging also you have to go through this loop 18 times... then how can you say algo i gave takes more time to debug.. complexity of given algo is O(n) and complexity of algo i gave is O(lg(n))....modified on Wednesday, March 3, 2010 10:37 PM
|
|
|
|
|
chevu wrote: how can you say algo i gave takes more time to debug.. complexity of given algo is O(n)
O(n) and O(lg(n)) apply to execution time, not debugging time.
There are no formulas for debugging time; it depends on number of statements, decision points, readability of code, and initial number of bugs. Your code has more than 5 bugs, it will take you lots of time to find all of them. I suggest you try and fix and run it until the result is correct.
|
|
|
|
|
thank you for answering to chevu - he didn't get the hint - "debug time"
|
|
|
|
|
that is completely wrong in many ways. did you try a simple example, say pow=1?
|
|
|
|
|
Is that an attempt at binary exponentiation?
|
|
|
|
|
OriginalGriff wrote: Still, I think I will stick to the old-fashioned, boring way:
decimal d = 10E18M;
decimal bigNumber = 1000000000000000000M;
This makes the old-fashioned way more exciting I have no smart signature yet...
|
|
|
|
|
using System;
namespace DecimalTest
{
class Program
{
static void Main(string[] args)
{
decimal bigNumber = 1000000000000000000M;
decimal bigNumber2 = 10E18M;
Console.WriteLine("Is {0} the same as {1}?", bigNumber, bigNumber2);
if (bigNumber == bigNumber2)
Console.WriteLine("WTF???");
else
Console.WriteLine("No - Maths saved!");
Console.ReadKey();
}
}
}
|
|
|
|
|
run your code -> how many digits do you count?
|
|
|
|
|
I did - and checked they gave the same results before I posted it. You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
lol - same results...
Check it:
using System;
namespace DecimalTest
{
class Program
{
static void Main(string[] args)
{
decimal divider;
divider = 10*10*10;
divider = Decimal.Multiply(divider,10*10*10*10*10);
divider = Decimal.Multiply(divider,10*10*10*10*10);
divider = Decimal.Multiply(divider,10*10*10*10*10);
Console.WriteLine(divider);
decimal tenE18 = 10;
for (int i = 0; i < 18; i++)
tenE18 *= 10;
Console.WriteLine(tenE18);
Console.WriteLine(10E18M);
Console.WriteLine(String.Format("{0:N}", Math.Pow(10d, 18d)));
Console.ReadKey();
}
}
}
who invented those nasty zero!?!
|
|
|
|
|
Yeah, I checked my results matched!
I didn't check his!
Oops.You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
yea - it was even hard for me to check his crazy code - lol. There is some resistence to execute such a thing -
|
|
|
|
|
|
chevu wrote: This one is correct code
wrong again:
1. the result for pow=18 is wrong.
2. pow=5 and pow=6 give the same result???
I think you have abundantly proven now that your code has high debugging complexity.
|
|
|
|
|
sorry dude... i had really forget to check till 18... coz of odd even cases that code will fail...
I knw you people are getting irritated by now, but you can check this code
double pow(long long a, long long b)
{
if(b == 0)
return 1.0;
else if(b == 1)
return a;
else if(b%2 == 0)
return pow(a*a,b/2);
else
return a* pow(a*a,b/2);
}
i have tested this code upto long long limits...
|
|
|
|
|
Recursive functions brings color in life I have no smart signature yet...
|
|
|
|
|
chevu wrote: long long a
If I were a canadian, thats how I would describe this thread.modified on Thursday, March 4, 2010 8:11 AM
|
|
|
|
|
|
Erm, a half-assed joke, you douche.
|
|
|
|