Click here to Skip to main content
15,914,014 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to replace every different char with another given char Pin
Member 1379031628-May-19 8:29
Member 1379031628-May-19 8:29 
GeneralRe: How to replace every different char with another given char Pin
Member 1379031628-May-19 20:19
Member 1379031628-May-19 20:19 
GeneralRe: How to replace every different char with another given char Pin
kalberts29-May-19 4:49
kalberts29-May-19 4:49 
GeneralRe: How to replace every different char with another given char Pin
OriginalGriff26-May-19 1:33
mveOriginalGriff26-May-19 1:33 
GeneralRe: How to replace every different char with another given char Pin
Member 1379031626-May-19 1:51
Member 1379031626-May-19 1:51 
GeneralRe: How to replace every different char with another given char Pin
OriginalGriff26-May-19 5:13
mveOriginalGriff26-May-19 5:13 
GeneralRe: How to replace every different char with another given char Pin
BillWoodruff26-May-19 1:51
professionalBillWoodruff26-May-19 1:51 
GeneralRe: How to replace every different char with another given char Pin
OriginalGriff26-May-19 3:09
mveOriginalGriff26-May-19 3:09 
GeneralRe: How to replace every different char with another given char Pin
BillWoodruff26-May-19 22:08
professionalBillWoodruff26-May-19 22:08 
GeneralRe: How to replace every different char with another given char Pin
OriginalGriff26-May-19 22:22
mveOriginalGriff26-May-19 22:22 
GeneralRe: How to replace every different char with another given char Pin
BillWoodruff26-May-19 22:55
professionalBillWoodruff26-May-19 22:55 
GeneralRe: How to replace every different char with another given char Pin
kalberts29-May-19 4:52
kalberts29-May-19 4:52 
GeneralRe: How to replace every different char with another given char Pin
OriginalGriff29-May-19 5:08
mveOriginalGriff29-May-19 5:08 
GeneralRe: How to replace every different char with another given char Pin
lmoelleb26-May-19 8:40
lmoelleb26-May-19 8:40 
AnswerRe: How to replace every different char with another given char Pin
Luc Pattyn25-May-19 19:16
sitebuilderLuc Pattyn25-May-19 19:16 
AnswerRe: How to replace every different char with another given char Pin
kalberts29-May-19 5:01
kalberts29-May-19 5:01 
QuestionFloating Point Calculations - c# vs. c++ Pin
User 1106097922-May-19 6:50
User 1106097922-May-19 6:50 
GeneralRe: Floating Point Calculations - c# vs. c++ PinPopular
harold aptroot22-May-19 7:00
harold aptroot22-May-19 7:00 
GeneralRe: Floating Point Calculations - c# vs. c++ Pin
User 1106097922-May-19 7:24
User 1106097922-May-19 7:24 
GeneralRe: Floating Point Calculations - c# vs. c++ Pin
CPallini22-May-19 23:01
mveCPallini22-May-19 23:01 
GeneralRe: Floating Point Calculations - c# vs. c++ Pin
User 1106097923-May-19 8:38
User 1106097923-May-19 8:38 
GeneralRe: Floating Point Calculations - c# vs. c++ Pin
kalberts29-May-19 5:21
kalberts29-May-19 5:21 
Makes me think of when I was playing around with APL: No distinction between int and float, no explicit declaration of type. All numerics were 64 bit FP.

To avoid problems with values that conceptually are the same, but due to limited precision may not be (such as 1/3 + 1/3 + 1/3 not necessarily being identical to 1.0), there was a user settable tolerance variable - if my memory is right, it was called quadFUZZ): In any comparing of numerics, if the difference was less that FUZZ, the values were treated as exactly equal. I believe something similar also exist in other highly environments, such as Smalltalk.)

I was teaching C++ programming for a few years. Any hand-ins where float variables were compared by == to constants or othter varibles did not pass. My teaching was to consider == an invalid operator for floats - use >, >=, <, <=. And where appropriate, code the APL style in longhand: if (abs(f1-f2) < fuzz) { ... treat as exactly equal.

Of course some students objected: "Why can't we just ...", and I had to explain over and over. One student went as far to hand in a homework which stared with a big block comment, headed by: "This is how REAL PROGRAMMERS would code the solution: ..." and after som real dirty code, at the end of the comment block: "But this is how our professor forces us to do it: " - and then some clean and readble code, not commented out. So he knew how to behave in a disciplined way, but refused do give up his undisciplined behaviour completely. Smile | :)
GeneralRe: Floating Point Calculations - c# vs. c++ Pin
User 1106097929-May-19 5:42
User 1106097929-May-19 5:42 
AnswerRe: Floating Point Calculations - c# vs. c++ Pin
#realJSOP24-May-19 0:07
professional#realJSOP24-May-19 0:07 
GeneralRe: Floating Point Calculations - c# vs. c++ Pin
User 1106097924-May-19 5:40
User 1106097924-May-19 5:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.