This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
debfa49
commit dc623c1
Showing
11 changed files
with
530 additions
and
557 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
#include <cstdint> | ||
|
||
#include "catch.hpp" | ||
|
||
extern "C" uint64_t Microsoft__Quantum__Testing__QIR__Math__TestSqrt__body(); // NOLINT | ||
extern "C" uint64_t Microsoft__Quantum__Testing__QIR__Math__SqrtTest__body(); // NOLINT | ||
|
||
TEST_CASE("QIR: math.sqrt", "[qir.math][qir.math.sqrt]") | ||
{ | ||
REQUIRE(0 == Microsoft__Quantum__Testing__QIR__Math__TestSqrt__body()); | ||
REQUIRE(0 == Microsoft__Quantum__Testing__QIR__Math__SqrtTest__body()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,20 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.Quantum.Testing.QIR.Math | ||
{ | ||
open Microsoft.Quantum.Intrinsic; | ||
|
||
function TestSqrt() : Int | ||
{ | ||
mutable testResult = 0; | ||
|
||
if( 2.0 != Sqrt( 4.0) ) { set testResult = 1; } | ||
else { if( 3.0 != Sqrt( 9.0) ) { set testResult = 2; } | ||
else { if( 10.0 != Sqrt(100.0) ) { set testResult = 3; } | ||
function SqrtTest() : Int { | ||
if( 2.0 != Sqrt( 4.0) ) { return 1; } | ||
if( 3.0 != Sqrt( 9.0) ) { return 2; } | ||
if(10.0 != Sqrt(100.0) ) { return 3; } | ||
|
||
else { if( not IsNan(Sqrt(-5.0))) { set testResult = 4; } | ||
else { if( not IsNan(Sqrt(NAN()))) { set testResult = 5; } | ||
else { if( not IsInf(Sqrt(INFINITY()))) { set testResult = 6; } | ||
}}}}} | ||
if( not IsNan(Sqrt(-5.0))) { return 4; } | ||
if( not IsNan(Sqrt(NAN()))) { return 5; } | ||
if( not IsInf(Sqrt(INFINITY()))) { return 6; } | ||
|
||
return testResult; | ||
return 0; | ||
} | ||
} | ||
|
Oops, something went wrong.