this repo has no description
1
2/*
3 * scalb.c
4 *
5 * by Ian Ollmann
6 *
7 * Copyright (c) 2007, Apple Inc. All rights reserved.
8 *
9 * Unix 2003 implementation of scalb.
10 */
11
12
13#include <math.h>
14#include <stdint.h>
15
16double scalb( double x, double y )
17{
18 // Handle y is NaN
19 if( y != y )
20 return x + y;
21
22 //clamp y
23 if( y > 3000.0 )
24 y = 3000.0;
25
26 if( y < -3000.0 )
27 y = -3000.0;
28
29 return scalbn( x, (int) y );
30}