HEX
Server: nginx/1.29.3
System: Linux 11979.bigscoots-wpo.com 6.8.0-88-generic #89-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 01:02:46 UTC 2025 x86_64
User: nginx (1068)
PHP: 7.4.33
Disabled: exec,system,passthru,shell_exec,proc_open,proc_close,popen,show_source,cmd# Do not modify this line # 1684243876
Upload Files
File: //usr/share/systemtap/examples/general/floatingpoint.stp
#!/usr/bin/stap

function printlnfp(a) { println(fp_to_string(a,5)) }

probe process("stap").function("sdt_benchmark_thread") {
    a = $fp1
    b = string_to_fp("3.14")
    c = long_to_fp(2)
   
    printf("a : %s, b : %s, c : %s\n", fp_to_string(a,5), fp_to_string(b,5), fp_to_string(c,5))
    printf("round 3.14 to long : %ld\n", fp_to_long(b, 0, 0))
    
    print("a + b * c = ")
    printlnfp(fp_add(a, fp_mul(b, c)))

    printf("sqrt(b) < b / c : ")
    println(fp_lt(fp_sqrt(b), fp_div(b, c)))

    exit()
}