Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,38 @@ namespace sfloat {
int fromInt(int x) {
return int_to_sfloat(x);
}

//% blockId=sfloat_add block="Add two SoftFloats %x %y"

/**
* Add two soft-floats
*/
//% blockId=sfloat_add block="add %x and %y"
int add(int x, int y)
{
return sfloat_add(x, y);
}

//% blockId=sfloat_add block="Multiply two SoftFloats %x %y"
/**
* Multiply two soft-floats
*/
//% blockId=sfloat_add block="multiply %x %y"
int multipy(int x, int y)
{
return sfloat_multiply(x, y);
}

//% blockId=sfloat_add block="Subtract two SoftFloats %x %y"
/**
* Subtract two soft-floats
*/
//% blockId=sfloat_add block="subtract %y from %x"
int minus(int x, int y)
{
return sfloat_minus(x, y);
}

//% blockId=sfloat_add block="Divide two SoftFloats %x %y"
/**
* Divide two soft-floats
*/
//% blockId=sfloat_add block="divide %x by %y"
int div(int x, int y)
{
return sfloat_divide(x, y);
Expand Down
2 changes: 1 addition & 1 deletion pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
"test.ts"
],
"public": true,
"installedVersion": "workspace:c19f6d3e-3838-4f36-ce2d-dffea6f77797"
"installedVersion": "workspace:de252d46-a55c-4e51-9ec9-5e5e21fcb1f4"
}
4 changes: 2 additions & 2 deletions shims.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ declare namespace sfloat {
/**
* Perform soft-float conversion
*/
//% blockId=sfloat_IntToSFloat block="Convert integer %x to SoftFloat representation" shim=sfloat::IntToSFloat
function IntToSFloat(x: number): number;
//% blockId=sfloat_fromInt block="Convert integer %x to SoftFloat representation" shim=sfloat::fromInt
function fromInt(x: int32): int32;
}

// Auto-generated. Do not edit. Really.