1 /* 2 * Copyright (C) 2010 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 #include <stdlib.h> 17 #include <stdio.h> 18 #include <string.h> 19 20 int main() 21 { 22 char buf[128]; 23 int error_count = 0; 24 float f = atof("90.099998474121094"); 25 printf("%f\n", f); 26 sprintf(buf, "%08x", *(unsigned*)&f); 27 error_count += strcasecmp("42b43333", buf); 28 29 f = atof("3.14"); 30 printf("%f\n", f); 31 sprintf(buf, "%08x", *(unsigned*)&f); 32 error_count += strcasecmp("4048f5c3", buf); 33 34 return error_count; 35 } 36