|
Because Convert.ToInt (and ToInt16 , ToInt32 , ToInt64 ) are conversion methods (as the "Convert" suggests); they take arguments that can be numeric (int, long etc) but can also be string, boolean, char, even DateTime etc. The Math.Floor / Round / Ceiling functions are mathematical functions that modify an existing numeric argument.
Whilst the result might be the same, they perform distinctly different purposes. [Plus, what John Simmons says! ]
|
|
|
|
|
in SQL, the statement of SELECT CONVERT(INT, 0.6) simply drops the decimal part and returns 0.
TOMZ_KV
|
|
|
|
|
That's another reason to dislike SQL!
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
I think Marc wrote SQL.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
He worked for IBM then.
TOMZ_KV
|
|
|
|
|
Well, 1 is 'more equivalent' than 0 .
|
|
|
|
|
(*)Inane Coding Style Question of the Day
Have you ever used two underscores ("__ ") in a row in an identifier, and why did you do it?
I have in my current code. I have C# properties that dig in to a structure, providing a 'flat' access API to it. The properties are named Structure__minimum , Structure__maximum , and so on. A single underscore didn't seem to distinguish the values sufficiently, while two seem to emphasize the relationship between the structure and the value being manipulated.
Excuse me a moment while I grab a stick and the bag of marshmallows. Let the flame wars begin!
Yes, I'm bored. I'm also somewhat chemically-enhanced in that I can feel a migraine coming on just in time for the weekend, and have a taken a pre-emptive round of meds .
Software Zen: delete this;
|
|
|
|
|
The only places a double underscore should ever be used is at the beginning or less commonly the end of an identifier!
Anywhere else is wrong.
Because: because!
Message Signature
(Click to edit ->)
|
|
|
|
|
I've always avoided double underscores at the beginning of an identifier because compiler vendors use them for their own purposes. "__int64 " comes to mind.
Software Zen: delete this;
|
|
|
|
|
I do it for compiler definitions. For instance :
#define __DEPRECATED__
It's a hold-over from my days of doing C++.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Hmm. I have done that trick in one spot in our 'legacy' C++ stuff. We had a pile of shared code that occasionally needed to know exactly which product it was being compiled in to:
#define __Product_A__ 0x00000001
#define __Product_B__ 0x00000002
#define __Product_C__ 0x00000003
...
#define __Product__ __Product_J__ We had non-preprocessor identifiers like "_Product " in a number of places, so the leading and trailing underscores helped.
Software Zen: delete this;
|
|
|
|
|
if (____ ^^ _______)
____________()
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
|
Apparently, it's quite popular in Python:
Wear a Dunder Cap - The Daily WTF[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I'm going to have to use this:This is an impressive amount of effort into constructing a footgun
Software Zen: delete this;
|
|
|
|
|
Saw some code once where someone had used varying numbers of underscores to keep column name lengths uniform.
He also didn't seem to be aware that SQL has a rather nifty DATETIME construct, so the code looked something like:
SELECT whatever
FROM Somebloodyawfullynamedtable
WHERE Monday____morning = 1 OR Tuesday__morning = 1 OR Wednesday_morning = 1 OR Thursday__morning = 1 ...
There were something close to 1,000 lines in a sproc which basically seemed to be there just to establish what day of the week an appointment was on and whether it was in the morning or afternoon!!!
Whenever you find yourself on the side of the majority, it is time to pause and reflect. - Mark Twain
|
|
|
|
|
I had trial version on VS 2017. Now that evaluation is expired, I went to uninstall it. It tells me to update the installer before I uninstall. Why? Why? WHY?
Something which installed it cannot uninstall it anymore?
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[ ^]
|
|
|
|
|
It's silly, but that is how the installer / updater works.
|
|
|
|
|
It's easy to get married but hard to get divorced.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
011111100010 wrote: It's easy to get married but hard to get divorced.
So by analogy, I have to upgrade Mistress before I can uninstall Wife?
Latest Article - A Concise Overview of Threads
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Marc Clifton wrote: So by analogy, I have to upgrade Mistress before I can uninstall Wife? That often does the trick. (So I've heard)
|
|
|
|
|
That has to be the BEST analogy I have ever read!
When you are dead, you won't even know that you are dead. It's a pain only felt by others.
Same thing when you are stupid.
modified 19-Nov-21 21:01pm.
|
|
|
|
|
I think that generally speaking, uninstallation of Wife requires a significant downgrade to Bank Account.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Except that Mistress is a rather funny application, whereas Wife is a full operating system. In place upgrades are barely likely to succeed.
667: The neighbour of the Beast
|
|
|
|
|
yes you will have to update the installer,
it'll the realise that your vs is itself not the latest, you'll have to update that too,
then you may uninstall it.
Are you sure?
now behave! that is the way ms made it.
there are no choices, ms has decided everything for you - in your best interest of course.
(Be reassured: the uninstaller will leave a sh*t load of crap behind, once again because ms have decided that is the best thing to do, because .... it's what you want must have.)
Message Signature
(Click to edit ->)
|
|
|
|