|
This reminds me:
We had a user, that despite taking the online training for our software, could not get various features to work. (All of them involved F-Keys, in hindsight, but she referred to them by their names, like Refresh, etc).
On a visit, I stopped by her desk, and I asked her to show me. When she was required to press F3 to search, she was PRESSING: F, and then 3
I was ASTOUNDED, until I realized she had never pulled her keyboard drawer fully open.
I pulled it open for her, and she excitedly exclaimed "Oh, do you think THEY meant that F3 key?"
I said "I don't know! Try it!", and, of course, it worked...
The manager overheard this, and as I walked to the other part of the office, TRYING TO PREVENT MY SKULL From exploding... He said "I know you will tell this story in the future, just promise me to NEVER mention the company!"... ROTFLMAO.
Users... They come in all varieties. And it's why engineers/testers fail to find the problems.
|
|
|
|
|
When my daughter was about the same age (2 decades ago), she inserted a linux install disc into our windows computer and by random key presses, not only installed linux, but forced a login for either partition with a root password of God only knows. Sigh.
After that we put a screenlock on with the failed password alert saying aloud, "No, no, Katie!" LOL
|
|
|
|
|
|
I've just forwarded this to one of my mentees. A Good Lesson.
|
|
|
|
|
I was reading about complex numbers in C# and saw this
Complex minusOne = new Complex(-1, 0);
Console.WriteLine(Complex.Sqrt(minusOne));
I'm curious: is there any reason one would not simply hardcode Complex.Sqrt(-1) to equal new Complex(0, 1); ?
The whole thing about complex numbers is they are based on the fundamental concept that i2 = -1. Why wouldn't you bake that in as an absolute and let the representational errors happen elsewhere?
I get that actually detecting all cases of √-1 is tricky and messy at best, but it's not like you can actually compare, with arbitrary precision, two floating point values anyway.
Future warning: if I ever get access to the .NET code in a way that lets me sneak in a change, then this will happen. It may cause manned spacecraft to veer off course and crash into the moon, or nuclear reactors to overheat and take out half a continent. But, dammit, √-1 will equal i.
cheers
Chris Maunder
|
|
|
|
|
If spacecraft or nuclear reactors are ever allowed to be run on .Net I will hide in a cave for the foreseeable future.
|
|
|
|
|
Ehm.. As a fellow swedish developer, I suggest you hide right now, because software I've written in C# is actually in a control room for a unnamed reactor. =)
|
|
|
|
|
But is it actually controlling the reactor?
|
|
|
|
|
Not directly but a crash will cause an emergency stop. // E
|
|
|
|
|
Ok, that's interesting.
I suppose it's not an off the shelf PC it's running on?
|
|
|
|
|
Everything runs on off the shelf pcs. That are 5+ years old. But on the other hand, the backups have backups.
There's some really, REALLY old stuff in there that's custom built, but that's even more scary. That's it, I better stop before I bust some NDA and get SÄPO after my ass. =)
// E
|
|
|
|
|
|
Two more words: Windows. XP. :'(
// E
|
|
|
|
|
I'm not sure if I should upvote or downvote that message
-= Reelix =-
|
|
|
|
|
It is not related to language-specific issues, but to floating point representation. Every language has these problems with basic floating-point data structures.
|
|
|
|
|
My concern isn't language specific nor floating point specific.
I'd rather not trust anything running on a PC for high security purposes.
|
|
|
|
|
Do you really work on an Itanium system? That's what the IA-64 instruction was for - the Intel Itanium systems.
The 64-bit instruction more commonly used today is called X64 and was originally developed by AMD.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Hmmm... how can I get .net on my Itanium (OpenVMS) system?
|
|
|
|
|
I work on whatever Tim Cook decides should be in my Macbook.
cheers
Chris Maunder
|
|
|
|
|
I have a guess. When dealing with stuff in mathematics that involves a degree of error, you want to treat all input consistently. Having some input that generates a value with error baked in and other input that generates a hard-coded exact value is a bad idea.
With Complex.Sqrt , they use polar coordinates to calculate the complex number. This is going to have some error baked in. If a developer using Complex is adjusting for error, and the operations on Complex treat some input differently (like -1), then this adjustment would remove the error from some cases and introduce error in others. If you want an error-less representation of Complex.Sqrt(-1) you can use Complex.ImaginaryOne .
That would be my reasoning at least.
|
|
|
|
|
I hope you know you just induced me to have a flashback to the graduate linear systems course I took in 1988, the last time I cared that i = √-1 was a thing.
I'm now going to have to spend the evening drinking hard apple cider, binge-watching Eureka[^], and talking to my sleeping greyhound in order to purge the memory from my neural cache.
Software Zen: delete this;
|
|
|
|
|
That looks like an implementation error. Does the 32-bit system have a 80x87 math coprocessor?
|
|
|
|
|
Well, I had to try it in C++...
#include <complex>
#include <iomanip>
#include <iostream>
int main() {
const auto a = std::complex<long double>{-1, 0};
const auto b = std::sqrt(a);
std::cout << std::setprecision(20) << "sqrt" << a << " -> " << b << "\n";
}
and that output
sqrt(-1,0) -> (0,1)
in gcc and clang.
And, as you have been a physicist, I figured maybe Fortran might be an alternative...
program test
implicit none
COMPLEX*8 a,b
a = (-1,0)
b = sqrt(a)
write (*,*) a,b
endprogram test
Guess what - sqrt(-1) == i there too:
(-1.00000000,0.00000000) (0.00000000,1.00000000)
And all the other non .NET languages I tried also gave the same answer... So I guess .NET is the outlier here!
With all that, though, they're still missing the negative root
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Are we sure that we are comparing like-with-like?
The original answers were (6.12303176911189E-17, 1) or (6.12323399573677E-17,1)
Your answers were (0.00000000,1.00000000)
If you display 6.12303176911189E-17 in a non-exponent form, it will come out as 0.00000000 because it is a rounded version of 0.000000000000000006123... (I may have miscounted the zeros)
So both answers may be representations of the same number. This is easy to test e.g. in FORTRAN which has an E format type for exponential and F for floating point.
|
|
|
|
|
Ugh. Excellent point.
cheers
Chris Maunder
|
|
|
|