Changeset 6424 in orxonox.OLD for trunk/src/subprojects/network
- Timestamp:
- Jan 7, 2006, 11:07:22 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/subprojects/network/network_unit_test.cc
r6341 r6424 136 136 137 137 /* create a server stream */ 138 nm->createServer( *serverSync,port);138 nm->createServer(port); 139 139 140 140 /* esatblish a connection */ … … 289 289 printf("%f = ", f); 290 290 printf(s); printf("\n"); 291 291 292 292 byte* res = Converter::floatToByteArray(f); 293 293 printf("Byte Array: "); … … 295 295 printf("%i ", res[i]); 296 296 printf("\n"); 297 297 298 298 float b = Converter::byteArrayToFloat(res); 299 299 printf("ReConvert: %f \n", b); … … 305 305 printf("### %f = ", f); 306 306 printf(s); printf("\n"); 307 307 308 308 byte* res = Converter::_floatToByteArray(f); 309 309 printf("Byte Array: "); … … 311 311 printf("%i ", res[i]); 312 312 printf("\n"); 313 313 314 314 float b = Converter::_byteArrayToFloat(res); 315 315 printf("ReConvert: %f \n", b); … … 324 324 printf("%i ", res[i]); 325 325 printf("\n"); 326 326 327 327 int z = Converter::byteArrayToInt(res); 328 328 329 329 printf("ReConvert: %i\n", z); 330 330 331 331 332 332 //float a = 5.4f; 333 333 //float b = 2.0f; 334 334 //printf("%f mod %f = %f", a, b, a % b); 335 336 printf("\n"); 337 335 336 printf("\n"); 337 338 338 */ 339 339 /* 340 340 float y; 341 341 char* s; 342 342 343 343 y = 12.0f; 344 344 s = Converter::floatToBinString(y); 345 345 printf("%f = ", y); 346 346 printf(s); printf("\n"); 347 347 348 348 y = 24549026.0f; 349 349 s = Converter::floatToBinString(y); 350 350 printf("%f = ", y); 351 351 printf(s); printf("\n"); 352 352 353 353 y = 12.4e20f; 354 354 s = Converter::floatToBinString(y); 355 355 printf("%f = ", y); 356 356 printf(s); printf("\n"); 357 357 358 358 y = 4.7824f; 359 359 s = Converter::floatToBinString(y); 360 360 printf("%f = ", y); 361 361 printf(s); printf("\n"); 362 362 363 363 y = -4.7824f; 364 364 s = Converter::floatToBinString(y); 365 365 printf("%f = ", y); 366 366 printf(s); printf("\n"); 367 367 368 368 y = -14.35e14f; 369 369 s = Converter::floatToBinString(y); … … 371 371 printf(s); printf("\n"); 372 372 */ 373 374 373 374 375 375 /* 376 376 float a = 12.3f; 377 377 378 378 char* s = Converter::floatToBinString(a); 379 379 printf("%f = ", a); 380 380 printf(s); printf("\n"); 381 381 382 382 byte* res = Converter::floatToByteArray(a); 383 383 printf("Byte Array: \n"); … … 385 385 printf("%i ", res[i]); 386 386 printf("\n"); 387 387 388 388 float b = Converter::byteArrayToFloat(res); 389 389 printf("ReConvert: %f \n", b); … … 392 392 // testFloatConverter(134.26455646546548741661675165f); printf("\n"); 393 393 // testFloatConverter(35.67e14f); printf("\n"); 394 394 395 395 testFloatConverter(12.3e-7f); printf("\n"); 396 396 testFloatConverter(134.26455646546548741661675165f); printf("\n"); 397 397 testFloatConverter(35.67e14f); printf("\n"); 398 398 399 399 return 0; 400 400 }
Note: See TracChangeset
for help on using the changeset viewer.