Tag Archives: float

Compare the performance of the int, long, and byte data types in C#

The example Compare the performance of the float, double, and decimal data types in C# compares the performance of the float, double, and decimal data types. This example performs a similar test for the int, long, and byte data types. … Continue reading

Posted in performance, variables | Tagged , , , , , , , , , , , | Leave a comment

Compare the performance of the float, double, and decimal data types in C#

A computer’s math coprocessor typically gives the best performance with a particular data type. To see which works best on my system and to learn how big the difference is, I wrote this program to compare the performance of calculations … Continue reading

Posted in performance, variables | Tagged , , , , , , , , , , | 6 Comments

Compare speeds of arithmetic operations in C#

This example compares the speeds of arithmetic operations with different data types. There’s a big difference between the speeds of operations using the decimal data type and the other types, so performing a loop a certain number of time is … Continue reading

Posted in algorithms, calculations, mathematics | Tagged , , , , , , , , , , , , , , , , | Leave a comment

Check text data type in C#

This example shows how to use the TryParse method to check text data type. Each data type (int, float, bool, etc.) has a TryParse method attempts to parse a string and returns true if it is successful. You can use … Continue reading

Posted in strings, variables | Tagged , , , , , , , , , , , , , , , , , , , , | Leave a comment