4160 of 161
Previous
Next 
Dec2Any  Convert a decimal number to any other base
by Francesco Balena
convert a positive number to any base
BASE can be in the range 236

Base Conversion module  A module to convert numbers between any bases
by Richard Deeming

Module: mBases
(C) 2000 Trinet Ltd, http://www.trinet.co.uk
Author: R. Deeming (richard@trinet.co.uk)
Purpose: To provide simple conversion between different
number bases, including fractional parts.
An example ...

Take advantage of the new math functions
by Francesco Balena
The System.Math class exposes several static methods that let you perform many common operations. These functions replace the VB6 functions with same name, but there are a few new functions that have no direct VB6 counterpart:
Ceiling(x) returns the integer equal or higher than the ...

A simple expression evaluator
by Francesco Balena
While any Windows user could pop up the Calculator accessory to perform any type of math calculations, it would be great if you could offer him or her the capability to do simple math from within your application. This is a very simple expression evaluator function that does it:

The Difference between 'Count' and 'Count(*)'
by Mahyar Ghasemali
'Count': Counts the number of nonnull values.

Obtain The Date Portion of a SQL Datetime Field
by Jason Ingram
Use this code: ...

CelsiusToFahrenheit, FahrenheitToCelsius  Convert temperature values
by Francesco Balena
convert from Celsius to Fahrenheit degrees

GetPrimeNumbers  Evaluate the first N prime numbers
by Francesco Balena
Returns an array with the first N prime numbers
Note: you can easily convert this routine to VB4 and VB5 by
returning the result array through an argument instead of
the return value

TriangleArea  Evaluate the area of any triangle given its sides
by Francesco Balena
evaluate the area of a triangle
given its three sides

What is a NaN?
by Danny Kalev
Due to hardware limitations and the finite nature of computer arithmetic, certain numeric values cannot be represented properly. These values include infinity, negative infinity, and so on. The ...

Using Uniqueidentifier(GUID) in Aggregate Operations (MS SQL Server)
by Michael Ginzburg
Uniqueidentifier(GUID) can't be used in aggregate operations like count(), ...

Generating Random Float Values
by Danny Kalev
To generate random floating numbers, choose a floating point number, divide it by the largest value of int type and multiply the result by the value of a function that generates random integers, ...

CComplexNumber  A class for dealing with complex numbers
by Francesco Balena

A class for dealing with complex numbers

The main properties

The fmod() Function
by Danny Kalev
The modulus operator can only be applied to integral types. To compute the remainder of two floating point variables, you have to use the fmod() function instead. Fmod() is declared in <cmath> ...

Crc16  Evaluate the 16bit CRC of an array of bytes
by Ernest Bayazitov
Evalutate the 16bit CRC (Cyclic Redundancy Checksum) of an array of bytes
If you omit the second argument, the entire array is considered

DecToFrac  Converts a decimal number into a fraction
by Daniel Corbier
Converts a decimal value into fractional parts as integers
(based on the concept of Continued Fractions)
Examples of usage:
Call DeclToFrac(0.125, a, b) ' 1 and 8 are returned in a & b
Call DecToFrac(5/40, a, b) ' 1 and 8 are also returned
Call DecToFrac(2/3, a, b) ' 2 and 3 are ...

NormRand  Produce random numbers with normal distribution
by Russell Lethbridge
VBA's intrinsic Rnd function returns numbers evenly
distributed between 0 and 1. Each number in that
interval has equal probability of being returned
for any given function call.
This function NormRand returns a random number between
infinity and +infinity distibuted normally around
zero ...

Changing the Endianness of a Number
by Danny Kalev
Suppose you receive an int from a remote host and you wish to convert it to bigendian order. Here is another portable solution for handling of big and ...

Send Emails From an Oracle Stored Procedure
by Jose Antonio
The following code is for those who need to receive emails from the ...

Determine whether the app is running on a flawed Pentium CPU
by Francesco Balena
Here's a simple test that you can use to determine whether the application is running on a system equipped with a Pentium CPU affected by the FDIV bug:
' return True if the CPU suffers from the FDIV bug
Function IsBuggedPentium() As Boolean
IsBuggedPentium = ((1 / 3221224323) ...

4160 of 161
Previous
Next 