Sha256: b012557b7528a86ff2521dee1ebcf8a8596cd9793f12bc578dcccf8b50777043

Contents?: true

Size: 686 Bytes

Versions: 50

Compression:

Stored size: 686 Bytes

Contents

#include "headers.h"

#undef unsigned
#undef double

double pow(double significand_, const double exponent) {
	unsigned int e;
	long double return_value;
	
	if (significand_ == 0.0) {
		if (exponent > 0.0) {
			return 0.0;
		}
		
		if (exponent == 0.0) {
			return 1.0;
		}
		
		return 1.0 / significand_;
	}
	
	e = (int)exponent;
	if (exponent == (int)e) {
		if ((int)e < 0) {
			e = -e;
			significand_ = 1.0 / significand_;
		}
		
		return_value = 1.0;
		
		while (1) {
			if (e & 1) {
				return_value *= significand_;
			}
			
			if (!(e >>= 1)) {
				break;
			}
			
			significand_ *= significand_;
		}
		
		return return_value;
	}
	
	return exp(log(significand_) * exponent);
}

Version data entries

50 entries across 49 versions & 6 rubygems

Version Path
ufos-1.0.94 ./other/old_compiler/shiltium7 (2)/misc_utils.c
aliens-1.0.94 ./other/old_compiler/shiltium7 (2)/misc_utils.c
freespeech-1.0.94 ./other/old_compiler/shiltium7 (2)/misc_utils.c
elonmusk-1.0.94 ./other/old_compiler/shiltium7 (2)/misc_utils.c
politics-1.0.94 ./other/old_compiler/shiltium7 (2)/misc_utils.c
democracy-1.0.94 ./other/old_compiler/shiltium7 (2)/misc_utils.c
democracy-1.0.93 ./other/old_compiler/shiltium7 (2)/misc_utils.c
ufos-1.0.91 ./other/old_compiler/shiltium7 (2)/misc_utils.c
aliens-1.0.91 ./other/old_compiler/shiltium7 (2)/misc_utils.c
freespeech-1.0.91 ./other/old_compiler/shiltium7 (2)/misc_utils.c
elonmusk-1.0.91 ./other/old_compiler/shiltium7 (2)/misc_utils.c
politics-1.0.91 ./other/old_compiler/shiltium7 (2)/misc_utils.c
politics-1.0.89 ./other/old_compiler/shiltium7 (2)/misc_utils.c
ufos-1.0.87 ./other/old_compiler/shiltium7 (2)/misc_utils.c
aliens-1.0.87 ./other/old_compiler/shiltium7 (2)/misc_utils.c
freespeech-1.0.87 ./other/old_compiler/shiltium7 (2)/misc_utils.c
elonmusk-1.0.87 ./other/old_compiler/shiltium7 (2)/misc_utils.c
politics-1.0.87 ./other/old_compiler/shiltium7 (2)/misc_utils.c
ufos-1.0.88 ./other/old_compiler/shiltium7 (2)/misc_utils.c
aliens-1.0.88 ./other/old_compiler/shiltium7 (2)/misc_utils.c