Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

texane
Copy link

@texane texane commented Nov 30, 2015

see #1661

@dpgeorge
Copy link
Member

Since the assert(0) was never hit by our tests we will now need some way to test this.

@texane
Copy link
Author

texane commented Nov 30, 2015

I used the following code in unix/main.c:

            ...
            mp_obj_t in1;
            mp_obj_t in2;

            in1 = mp_obj_new_int(42);
            in2 = mp_obj_new_float(-42.43);
            mp_store_name(QSTR_FROM_STR_STATIC("in1"), in1);
            mp_store_name(QSTR_FROM_STR_STATIC("in2"), in2);

            ret = do_file(argv[a]);

            in1 = mp_load_name(QSTR_FROM_STR_STATIC("in1"));
            in2 = mp_load_name(QSTR_FROM_STR_STATIC("in2"));
            printf("%d %lf\n", mp_obj_int_get_checked(in1), mp_obj_float_get(in2));

            ...

@pfalcon
Copy link
Contributor

pfalcon commented Dec 2, 2015

I can tell why I didn't make change like this - because I still don't feel comfortable with cutting libc support for printing floats. That may bite. So, I kind left some time to let there be more testing, while leaving hint which that comment gives.

Well, ok, let's have this merged.

@pfalcon
Copy link
Contributor

pfalcon commented Dec 2, 2015

@texane : Merged, thanks. We'd like to have more detailed commit messages, cf. how I changes yours: e042f48

@texane
Copy link
Author

texane commented Dec 2, 2015

Thanks. I will be careful with the message in future requests.

tannewt added a commit to tannewt/circuitpython that referenced this pull request Mar 19, 2019
It was confusing in displayio.

Fixes micropython#1662
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants