Skip to content

Commit

Permalink
support the scientific notation when parsing layer's paramters.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yantao Xie authored and nihui committed Apr 23, 2018
1 parent d0bcda7 commit 89c7aa2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/paramdict.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

#include <ctype.h>
#include "paramdict.h"
#include "platform.h"

Expand Down Expand Up @@ -74,7 +75,7 @@ static bool vstr_is_float(const char vstr[16])
if (vstr[j] == '\0')
break;

if (vstr[j] == '.')
if (vstr[j] == '.' || tolower(vstr[j]) == 'e')
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion tools/ncnn2mem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static bool vstr_is_float(const char vstr[16])
if (vstr[j] == '\0')
break;

if (vstr[j] == '.')
if (vstr[j] == '.' || tolower(vstr[j]) == 'e')
return true;
}

Expand Down

0 comments on commit 89c7aa2

Please sign in to comment.