Check sqrt through the double adapter
ASPL 0.7.0 · Current release
Call sqrt with 4.0 through the exact double profile and verify 2.0 without output.
On this page
Purpose and preparation
Native only, ASPL 0.7.0 on x86-64 Linux with glibc. Requires libm.so.6 with sqrt. No input lines, source modules or data assets. The program tests sqrt(4.0) against 2.0; success has no output and status 0.
Native installation · C guide · Foreign API · C collection.
Arabic source
Native only. Download this supplied variant unchanged.
Execution: Native only · ASPL 0.7.0
- Native only. ASPL 0.7.0, x86-64 Linux with glibc; requires libm.so.6 and sqrt. No source modules or data assets.
Input: No input lines are required.
غير_آمن خارجي جذر(قيمة: ع64) -> ع64
= سي_مزدوج__مزدوج("libm.so.6", "sqrt").
دالة ابدأ_الرئيسية() -> ص64 {
دع النتيجة = غير_آمن جذر(4.0).
إذا النتيجة تطابق 2.0 { أرجع 0. }
أرجع 1.
}
Follow the Linux instructions to run this example. Download the source to keep a copy.
Download ضعف.لباتExpected outcomes
{
"browser": {
"check": "policy-rejection",
"class": "policy-rejection",
"reason": "foreign-imports-not-supported",
"output": ""
},
"native": {
"check": 0,
"status": 0,
"output": ""
}
}English source
Native only. Download this supplied variant unchanged.
Execution: Native only · ASPL 0.7.0
- Native only. ASPL 0.7.0, x86-64 Linux with glibc; requires libm.so.6 and sqrt. No source modules or data assets.
Input: No input lines are required.
unsafe foreign root(value: f64) -> f64
= c_double__double("libm.so.6", "sqrt");
fn start_main() -> i64 {
let result_value = unsafe root(4.0);
if result_value matches 2.0 { return 0; }
return 1;
}
Follow the Linux instructions to run this example. Download the source to keep a copy.
Download double.asplExpected outcomes
{
"browser": {
"check": "policy-rejection",
"class": "policy-rejection",
"reason": "foreign-imports-not-supported",
"output": ""
},
"native": {
"check": 0,
"status": 0,
"output": ""
}
}Check the result
Source cards show exact catalog outcomes, original downloads, digests and supplied vocabulary. A nonzero example return indicates a failed assertion or handled library failure.
aspl check double.aspl
aspl run double.aspl
aspl build -o double-program double.aspl
./double-program