Added Decimal support for complex number

This commit is contained in:
sergeych committed 2026-03-30 08:20:55 +03:00
1 parent 8a560f5417
commit 286ec30422
4 files changed
+136 -4

No files matched your search

@@ -73,4 +73,32 @@ class ComplexModuleTest {
""".trimIndent()
)
}
@Test
fun testInferences() = runTest {
eval(
$$"""
import lyng.decimal
import lyng.complex
assert( 1.i is Complex )
assert( 5 + 1.i is Complex )
""".trimIndent()
)
}
@Test
fun testDecimalInferences() = runTest {
eval(
$$"""
import lyng.decimal
import lyng.complex
assert( 1.d.i is Complex )
assert( 5 + 1.d.i is Complex )
assert( 5.d + 1.i is Complex )
assert( 5.d + 2.d.i is Complex )
""".trimIndent()
)
}
}